package 代码记录.Bit48天集训;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**1.汽水瓶
 * 2.查找两个字符串a,b的最长公共子串
 * @author zx
 * @create 2022-05-16 7:49
 */
public class day_19 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int n = sc.nextInt();
            if(n < 2){
                break;
            }
            int res = 0;
            int temp = 0;//上次换购剩余的空瓶
            while(n >= 3){
                n -= 3;
                res++;
                n++;
            }
            if(n == 2){
                res++;
            }
            System.out.println(res);
        }
    }

    public static void main2(String[] args){
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
        String str3,str4;
        if(str1.length() >= str2.length()){
            str3 = str2;//str3是最长的
        }else{
            str3 = str1;
        }
        if(str1.length() < str2.length()){
            str4 = str1;
        }else{
            str4 = str2;//str4是最短的
        }
        int left = 0;
        Set<String> set = new HashSet<>();
        for(int right = 0;right < str3.length();right++){

        }
        //思路：遍历最短的字符串,将各个长度的字符串加入到set中
        //然后对最长的使用滑动窗口,如果set中包含,返回
    }
}
